# 定义Rectangle类
class Rectangle:
    def __init__(self, width, height):
        self.width = width
        self.height = height

    # 计算矩形面积
    def area(self):
        return self.width * self.height

    # 计算矩形周长
    def perimeter(self):
        return 2 * (self.width + self.height)


# 进行数据输入
w = int(input('请输入矩形的宽：'))
h = int(input('请输入矩形的高：'))
# 引用类进行运算
rectangle = Rectangle(width=w, height=h)
print("矩形的面积是:", rectangle.area())
print("矩形的周长是:", rectangle.perimeter())